//////////////////////////////////////////////////////////////////////////////////
//	 Copyright 2011 by Yosef Grabivker, ryuho@homenetworksoft.com
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
//////////////////////////////////////////////////////////////////////////////////

#ifndef _GENERAL_OPT_YG_H__
#define _GENERAL_OPT_YG_H__

#include "def.h"
#include <wx/panel.h>

class CGeneralOptions: public wxPanel
{
public:
								CGeneralOptions(wxWindow* pParent);
	virtual						~CGeneralOptions(void);

	//Run at startup
	bool						GetBootRun();
	void						SetBootRun(bool bVal=true);

	//Check for updates
	bool						GetUpdCheck();
	void						SetUpdCheck(bool bVal=true);

	//NAT Optimization
	bool						GetEnableNATOpt();
	void						SetEnableNATOpt(bool bVal=true);

	//NAT Size Optimization
	bool						GetEnableNATSizeOpt();
	void						SetEnableNATSizeOpt(bool bVal=true);

	//Peer To Peer
	bool						GetEnableP2PNetworkOpt();
	void						SetEnableP2PNetworkOpt(bool bVal=true);

	//WWW
	bool						GetEnableWWWOpt();
	void						SetEnableWWWOpt(bool bVal=true);

	//Language
	long						GetLanguage();
	void						SetLanguage(long lVal);

	//TCP
	bool						GetEnableTCPOpt();
	void						SetEnableTCPOpt(bool bVal=true);

	//icmp
	bool						GetEnableICMPOpt();
	void						SetEnableICMPOpt(bool bVal=true);

	//advanced
	bool						GetEnableAdvancedOpt();
	void						SetEnableAdvancedOpt(bool bVal=true);

	//advanced opt string
	STRINGPAIRLIST				GetAdvancedOptList()						 { return m_lstAdvancedOpt;  }
	void						SetAdvancedOptList(const STRINGPAIRLIST& val){ m_lstAdvancedOpt = val;	 }

	//Start up script
	void						SetEnableStartUpScript( bool bSet );
	bool						GetEnableStartUpScript();

	void						SetStartUpScriptFileName( const wxString& str );
	wxString					GetStartUpScriptFileName();

	//Proc Kill
	void						SetEnableProcKill( bool bSet );
	bool						GetEnableProcKill();

	TEXTLIST					GetProcKillList() { return m_lstKillProc;  }
	void						SetProcKillList(const TEXTLIST& val){ m_lstKillProc = val;	 }

	//Mod Unload
	void						SetEnableModUnload( bool bSet );
	bool						GetEnableModUnload();

	TEXTLIST					GetModUnloadList() { return m_lstUnloadMod;  }
	void						SetModUnloadList(const TEXTLIST& val){ m_lstUnloadMod = val;	 }


protected:
	void						InitLangCombo();
	void						SelectLang(long lang);
	void						OnLangChanged(wxCommandEvent&);
	void						OnOptimzCheckBoxes(wxCommandEvent& ev);
	void						OnOptimzAdvancedCheckBox(wxCommandEvent& ev);
	void						OnAdvanced(wxCommandEvent& ev);
	void						OnSelectStartUpScriptFileName(wxCommandEvent& event);
	void						OnTogleStartUpScript(wxCommandEvent& event);
	void						OnSelectProcList(wxCommandEvent& event);
	void						OnSelectModList(wxCommandEvent& event);
	void						OnUnloadProcButtonUI(wxUpdateUIEvent& event);
	void						OnUnloadModButtonUI(wxUpdateUIEvent& event);

	DECLARE_EVENT_TABLE()

private:
	class wxCheckBox*			m_pBootRun;
	class wxCheckBox*			m_pCheckForUpd;
	class wxComboBox*			m_pcLanguage;
	class wxCheckBox*			m_pcbNatSizeOpt;

	class wxCheckBox*			m_pcbNatOpt;
	class wxCheckBox*			m_pcbTCPOpt;
	class wxCheckBox*			m_pcbICMPOpt;

	class wxRadioButton*		m_pcbPeerToPeerOpt;
	class wxRadioButton*		m_pcbWWWOpt;

	class wxRadioButton*		m_pcbAdvanced;

	
	long						m_langid;
	STRINGPAIRLIST				m_lstAdvancedOpt;

	//StartUp Script
	class wxCheckBox*			m_pcbEnableSSCRPT;
	class wxStaticBoxSizer*		m_pSSCRPTBox;
	class wxTextCtrl*			m_ptcDirName;
	

	//Memory
	class wxCheckBox*			m_pcbEnableKillProc;
	class wxCheckBox*			m_pcbEnableUnloadMod;
	
	TEXTLIST					m_lstKillProc;
	TEXTLIST					m_lstUnloadMod;
	

	/*
	class wxTextCtrl*			m_pPortForwardHiBound;
	wxString					m_strPortHiBound;
	*/

};

#endif //_GENERAL_OPT_YG_H__
